//
//  BookManager.m
//  OC03_Homework
//
//  Created by dllo on 16/7/6.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "BookManager.h"

@implementation BookManager

- (void)addBook:(Book *)book
{
    [self.arrayLibrary addObject:book];
}

- (void)removeBook:(Book *)book
{
    if (book) {
        [self.arrayLibrary removeObject:book];
    }
}

- (void)findBookWithName:(NSString *)name changePrice:(NSInteger)price
{
    for (Book *temp in self.arrayLibrary) {
        if ([temp.name isEqualToString:name]) {
            temp.price = price;
        }
    }
}

- (void)list
{
    for (Book *book in self.arrayLibrary) {
        NSLog(@"%@", book.name);
    }
}
@end
